//
//  RegistViewController.m
//  LanQiuQuan
//
//  Created by TonyGenius on 16/3/18.
//  Copyright © 2016年 Rip. All rights reserved.
//

#import "RegistViewController.h"

@interface RegistViewController ()

@property (weak, nonatomic) IBOutlet UITextField *phoneTextField;

@property (weak, nonatomic) IBOutlet UITextField *passWordTextField;

@property (weak, nonatomic) IBOutlet UITextField *codeTextField;

@property (weak, nonatomic) IBOutlet UIButton *declarationBtn;

@end

@implementation RegistViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self initNavBar];
    [self initButton];
}

- (void)initNavBar
{
    self.navigationController.navigationBarHidden = NO;
    self.navigationItem.title = @"注册";
    
    UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"back"] style:UIBarButtonItemStyleDone target:self action:@selector(back)];
    
    backItem.tintColor = [UIColor whiteColor];
    self.navigationItem.leftBarButtonItem = backItem;
    
}

- (void)initButton
{
    NSMutableAttributedString *mutAttrString = [[NSMutableAttributedString alloc] initWithString:_declarationBtn.titleLabel.text];
    NSRange range = {0,[mutAttrString length]};
    [mutAttrString addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInteger:NSUnderlineStyleSingle] range:range];
    NSDictionary *dic = @{NSUnderlineStyleAttributeName:[NSNumber numberWithInteger:NSUnderlineStyleSingle],NSForegroundColorAttributeName:[UIColor colorWithRed:96/255.0 green:223/255.0 blue:234/255.0 alpha:1]};
    
    [mutAttrString addAttributes:dic range:range];
    [_declarationBtn setAttributedTitle:mutAttrString forState:UIControlStateNormal];
//    [_declarationBtn setTitleColor:[UIColor colorWithRed:96/255.0 green:223/255.0 blue:234/255.0 alpha:1] forState:UIControlStateNormal];
}

- (void)back
{
    [self.navigationController popViewControllerAnimated:YES];
}

- (IBAction)sendCode:(id)sender {
}

- (IBAction)registBtn:(id)sender {
}

- (IBAction)lawBtn:(id)sender {
}

- (IBAction)changeBtn:(UIButton *)sender {
    sender.highlighted = YES;
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    [self.view endEditing:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
